home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
BPAS9.ARJ
/
FACTORIA.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1990-10-30
|
374b
|
25 lines
PROGRAM Factorial;
USES
Crt;
VAR
N : Integer;
FUNCTION Fact ( N : Integer ) : Integer;
BEGIN
IF N < 0 THEN Write (' N is undefined. ')
ELSE
IF N > 0 THEN
Fact := N * Fact ( N - 1 )
ELSE
Fact := 1
END;
BEGIN
ClrScr;
WriteLn;
Write('Enter an integer: '); ReadLn ( N );
Write ( Fact ( N ): 10 );
ReadLn
END.